package com.blogspot.sunserenity;

import java.math.BigInteger;

public interface AsyncCipher {
	void generateKeys() throws Exception;
	AsyncKey getPublicKey ();
	byte[] encrypt (byte[] msg, AsyncKey publicKey);
	byte[] decrypt (byte[] cipher);
	
	public static class AsyncKey {
		private BigInteger exp, mod;
		
		public AsyncKey (BigInteger first, BigInteger second) {
			setExponenta(first);
			setModulus(second);
		}

		public BigInteger getExponenta() {
			return exp;
		}

		public void setExponenta(BigInteger first) {
			this.exp = first;
		}

		public BigInteger getModulus() {
			return mod;
		}

		public void setModulus(BigInteger second) {
			this.mod = second;
		}
	}
}
